
Partial Class GTSWeb_Shipment_FinalizeShipment
    Inherits System.Web.UI.Page

    Private TotalAmount As Double
    Private CarrierID As Integer
    Private GST As Double
    Private PST As Double
    Private HST As Double
    Private SurchargeAmount As Double
    Private ReferenceNumber As Integer
    Private ShipmentMgr As GTSSystem.BLL.Shipment
    Private ShipmentData As GTSDAL.ShipmentDataTable

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Try
            '"ReferenceNumber,CarrierID,Rate,GST,PST,,HST,Surcharge,Total"
            TotalAmount = Convert.ToDouble(Request.QueryString("Total"))
            GST = Convert.ToDouble(Request.QueryString("GST"))
            PST = Convert.ToDouble(Request.QueryString("PST"))
            HST = Convert.ToDouble(Request.QueryString("HST"))
            SurchargeAmount = Convert.ToDouble(Request.QueryString("Surcharge"))
            CarrierID = Convert.ToInt32(Request.QueryString("CarrierID"))
            ReferenceNumber = Convert.ToInt32(Request.QueryString("ReferenceNumber"))
            ShipmentMgr = New GTSSystem.BLL.Shipment
            ShipmentData = ShipmentMgr.getShipmentByReferencenumber(ReferenceNumber)
            ShipmentMgr.UpdateShipment(ReferenceNumber, ShipmentData.Item(0).ShipmentDate, Profile.ClientId, Profile.BranchId, CarrierID, ShipmentData.Item(0).Weight, ShipmentData.Item(0).OriginID, ShipmentData.Item(0).OriginAddress, ShipmentData.Item(0).OriginPostalCode, ShipmentData.Item(0).DestinationID, ShipmentData.Item(0).DestinationID, ShipmentData.Item(0).DestinationPostalCode, ShipmentData.Item(0).ServiceTypeID, ShipmentData.Item(0).Description, GST, PST, HST, ShipmentData.Item(0).Surcharge, ShipmentData.Item(0).NrOfPieces, Profile.UserName, 2, ShipmentData.Item(0).ShipmentNumber, TotalAmount, SurchargeAmount)
        Catch ex As Exception
            lblMessage.Text = "System Error: <br>" + ex.GetHashCode.ToString
        End Try
    End Sub

    Protected Sub lnkBOL_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lnkBOL.Click
        Response.Redirect("~\GTSWeb\Reports\BillOfLading.aspx?ReferenceNumber=" + ReferenceNumber.ToString)
    End Sub

    Protected Sub lnkRO_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lnkRO.Click
        Response.Redirect("~\GTSWeb\Reports\RoutingOrder.aspx?ReferenceNumber=" + ReferenceNumber.ToString)
    End Sub
End Class
